'use strict'
import React from 'react'
import style from '../css.css'
import List from './list'
const { inapp_info } = serverData

class ListPage extends React.Component {
  constructor (props) {
    super(props)
    this.state = {}
  }

  _renderList () {
    const { list } = serverData
    const { name } = this.props

    const arr = list.map((item, index) => {
      return (
        <List key={index} title={item.title} name={name} num={index + 1} />
      )
    })

    return arr
  }

  _goQsapp () {
    window.location.href = 'https://www.qiushibaike.com/download?from=act'
  }
  _renderGoapp () {
    if (inapp_info == 0) {
      return (<div>
        <div className={style.bottomText}>
          看到最后啦！<br />去糗事百科可以看更多搞笑糗事↓
        </div>
        <div className={style.qsBanner} onClick={this._goQsapp}></div>
      </div>)
    }
  }
  render () {
    return (
      <div className={style.listPage}>
        <div className={style.listTitle}></div>
        {this._renderList()}

        {this._renderGoapp()}
      </div>
    )
  }
}

export default ListPage
